From 17b42fb6cd46ee5442e89f33239c488ef520a8f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sun, 28 Aug 2005 00:11:03 +0000 Subject: [PATCH] file renames --- ChangeLog | 15 +++ babl/Makefile.am | 8 +- babl/babl-classes.c | 66 ----------- babl/babl-fish.c | 2 +- babl/babl-pixel-format.c | 237 --------------------------------------- babl/babl-pixel-format.h | 28 ----- babl/babl.h | 2 +- 7 files changed, 21 insertions(+), 337 deletions(-) delete mode 100644 babl/babl-classes.c delete mode 100644 babl/babl-pixel-format.c delete mode 100644 babl/babl-pixel-format.h diff --git a/ChangeLog b/ChangeLog index 3b4c1d0..3f1e2a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-08-28 Øyvind Kolås + + * babl/babl-pixel-format.c: removed + * babl/babl-format.c: readded under new name. + + * babl/babl-pixel-format.h: removed + * babl/babl-format.h: readded under new name. + + * babl/babl-classes.c: removed + * babl/babl-internal.c: readded under new name. + + * babl/babl.h, + * babl/Makefile.am, + * babl/babl-fish.c: Accomodate changes. + 2005-08-28 Øyvind Kolås diff --git a/babl/Makefile.am b/babl/Makefile.am index a8f2465..c78df67 100644 --- a/babl/Makefile.am +++ b/babl/Makefile.am @@ -4,17 +4,17 @@ SUBDIRS = base c_sources = \ babl.c \ - babl-classes.c \ babl-core.c \ babl-component.c \ babl-conversion.c \ babl-extension.c \ babl-fish.c \ + babl-format.c \ babl-image.c \ + babl-internal.c \ babl-introspect.c \ babl-memory.c \ babl-model.c \ - babl-pixel-format.c \ babl-sampling.c \ babl-sanity.c \ babl-type.c \ @@ -27,6 +27,7 @@ h_sources = \ babl-conversion.h \ babl-db.h \ babl-extension.h \ + babl-format.h \ babl-ids.h \ babl-instance.h \ babl-internal.h \ @@ -35,7 +36,6 @@ h_sources = \ babl-fish.h \ babl-memory.h \ babl-model.h \ - babl-pixel-format.h \ babl-sampling.h \ babl-sanity.h \ babl-type.h \ @@ -54,7 +54,7 @@ library_include_HEADERS = \ babl-image.h \ babl-instance.h \ babl-model.h \ - babl-pixel-format.h \ + babl-format.h \ babl-sampling.h \ babl-type.h diff --git a/babl/babl-classes.c b/babl/babl-classes.c deleted file mode 100644 index 749d58f..0000000 --- a/babl/babl-classes.c +++ /dev/null @@ -1,66 +0,0 @@ -/* babl - dynamically extendable universal pixel conversion library. - * Copyright (C) 2005, Øyvind Kolås. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "babl-internal.h" - -static const char *class_names[] = - { - "BablInstance", - "BablType", - "BablTypeInteger", - "BablTypeFloat", - "BablSampling", - "BablComponent", - "BablModel", - "BablFormat", - "BablConversion", - "BablConversionType", - "BablConversionTypePlanar", - "BablConversionModelPlanar", - "BablConversionFormat", - "BablConversionFormatPlanar", - "BablFish", - "BablFishReference", - "BablImage", - "BablExtenstion", - "BablSky" - }; - -const char * -babl_class_name (BablClassType klass) -{ - return class_names[klass-BABL_INSTANCE]; -} - -/* global variable, indicating whether name lookups - * are frowned upon or not (they are frowned upon within BablBase, - * since that leads to more strings than neccesary in the library.) - */ -int babl_hmpf_on_name_lookups = 0; - -void -babl_internal_init (void) -{ -} - -void -babl_internal_destroy (void) -{ -} - diff --git a/babl/babl-fish.c b/babl/babl-fish.c index 329e15f..da7933e 100644 --- a/babl/babl-fish.c +++ b/babl/babl-fish.c @@ -27,7 +27,7 @@ #include "babl-model.h" #include "babl-image.h" #include "babl-component.h" -#include "babl-pixel-format.h" +#include "babl-format.h" static int each_babl_fish_destroy (Babl *babl, diff --git a/babl/babl-pixel-format.c b/babl/babl-pixel-format.c deleted file mode 100644 index 2a53193..0000000 --- a/babl/babl-pixel-format.c +++ /dev/null @@ -1,237 +0,0 @@ -/* babl - dynamically extendable universal pixel conversion library. - * Copyright (C) 2005, Øyvind Kolås. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include -#include - -#include "babl-internal.h" -#include "babl-sampling.h" -#include "babl-type.h" -#include "babl-component.h" -#include "babl-db.h" - -static int -each_babl_format_destroy (Babl *babl, - void *data) -{ - babl_free (babl->format.from); - babl_free (babl->format.to); - babl_free (babl); - - return 0; /* continue iterating */ -} - -static Babl * -format_new (const char *name, - int id, - int planar, - int components, - BablModel *model, - BablComponent **component, - BablSampling **sampling, - BablType **type) -{ - Babl *babl; - - { - int i; - /* i is desintation position */ - for (i=0 ; icomponents; i++) - { - int j; - - for (j=0;jcomponent[i]) - goto component_found; - } - babl_log ("matching source component for %s in model %s not found", - model->component[i]->instance.name, model->instance.name); - exit (-1); - component_found: - ; - } - } - - /* allocate all memory in one chunk */ - babl = babl_malloc (sizeof (BablFormat) + - strlen (name) + 1 + - sizeof (BablComponent*) * (components) + - sizeof (BablSampling*) * (components) + - sizeof (BablType*) * (components) + - sizeof (int) * (components) + - sizeof (int) * (components)); - - babl->format.from = NULL; - babl->format.to = NULL; - babl->format.component = ((void *)babl) + sizeof (BablFormat); - babl->format.type = ((void *)babl->format.component) + sizeof (BablComponent*) * (components); - babl->format.sampling = ((void *)babl->format.type) + sizeof (BablType*) * (components); - babl->instance.name = ((void *)babl->format.sampling) + sizeof (BablSampling*) * (components); - - babl->class_type = BABL_FORMAT; - babl->instance.id = id; - - strcpy (babl->instance.name, name); - - babl->format.model = model; - babl->format.components = components; - - memcpy (babl->format.component, component, sizeof (BablComponent*) * components); - memcpy (babl->format.type , type , sizeof (BablType*) * components); - memcpy (babl->format.sampling , sampling , sizeof (BablSampling*) * components); - - babl->format.planar = planar; - - babl->format.bytes_per_pixel = 0; - { - int i; - for (i=0;iformat.bytes_per_pixel += type[i]->bits/8; - } - - return babl; -} - -Babl * -babl_format_new (const char *name, - ...) -{ - va_list varg; - Babl *babl; - int id = 0; - int planar = 0; - int components = 0; - BablModel *model = NULL; - BablComponent *component [BABL_MAX_COMPONENTS]; - BablSampling *sampling [BABL_MAX_COMPONENTS]; - BablType *type [BABL_MAX_COMPONENTS]; - - BablSampling *current_sampling = (BablSampling*) babl_sampling (1,1); - BablType *current_type = (BablType*) babl_type_id (BABL_U8); - const char *arg = name; - - va_start (varg, name); - - - while (1) - { - arg = va_arg (varg, char *); - if (!arg) - break; - - - if (BABL_IS_BABL (arg)) - { - Babl *babl = (Babl*)arg; - - switch (babl->class_type) - { - case BABL_TYPE: - current_type = (BablType*) babl; - break; - case BABL_COMPONENT: - if (!model) - { - babl_log ("no model specified before component %s", - babl->instance.name); - } - component [components] = (BablComponent*) babl; - type [components] = current_type; - sampling [components] = current_sampling; - components++; - - if (components>=BABL_MAX_COMPONENTS) - { - babl_log ("maximum number of components (%i) exceeded for %s", - BABL_MAX_COMPONENTS, name); - } - break; - case BABL_SAMPLING: - current_sampling = (BablSampling*)arg; - break; - case BABL_MODEL: - if (model) - { - babl_log ("args=(%s): model %s already requested", - babl->instance.name, model->instance.name); - } - model = (BablModel*)arg; - break; - case BABL_INSTANCE: - case BABL_FORMAT: - case BABL_CONVERSION: - case BABL_CONVERSION_TYPE: - case BABL_CONVERSION_TYPE_PLANAR: - case BABL_CONVERSION_MODEL_PLANAR: - case BABL_CONVERSION_FORMAT: - case BABL_CONVERSION_FORMAT_PLANAR: - case BABL_FISH: - case BABL_FISH_REFERENCE: - case BABL_IMAGE: - babl_log ("%s unexpected", - babl_class_name (babl->class_type)); - break; - case BABL_SKY: /* shut up compiler */ - break; - } - } - /* if we didn't point to a babl, we assume arguments to be strings */ - else if (!strcmp (arg, "id")) - { - id = va_arg (varg, int); - } - - else if (!strcmp (arg, "packed")) - { - planar = 0; - } - - else if (!strcmp (arg, "planar")) - { - planar = 1; - } - - else - { - babl_log ("unhandled argument '%s' for format '%s'", arg, name); - exit (-1); - } - } - - va_end (varg); - - - babl = format_new (name, id, - planar, components, model, - component, sampling, type); - - - if (db_insert (babl) == babl) - { - return babl; - } - else - { - each_babl_format_destroy (babl, NULL); - return NULL; - } -} - -BABL_CLASS_TEMPLATE (babl_format) diff --git a/babl/babl-pixel-format.h b/babl/babl-pixel-format.h deleted file mode 100644 index ed3329c..0000000 --- a/babl/babl-pixel-format.h +++ /dev/null @@ -1,28 +0,0 @@ -/* babl - dynamically extendable universal pixel conversion library. - * Copyright (C) 2005, Øyvind Kolås. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef _BABL_FORMAT_H -#define _BABL_FORMAT_H - -#include "babl-classes.h" -#include "babl-instance.h" - -BABL_DEFINE_CLASS (babl_format) - -#endif diff --git a/babl/babl.h b/babl/babl.h index bc0efa3..88249d6 100644 --- a/babl/babl.h +++ b/babl/babl.h @@ -33,7 +33,7 @@ #include "babl-fish.h" #include "babl-image.h" #include "babl-model.h" -#include "babl-pixel-format.h" +#include "babl-format.h" #include "babl-type.h" #include "babl-sampling.h" -- 2.30.2